<include file="../Public/_header.html" />
<style>
<!--
#confirm{
	float:left;
	width: 745px;
	text-align:left;
    background: none repeat scroll 0 0 #FFFFFF;
    margin: 0px auto;	
}


#confirm_inside{
    background-color: #FFFFFF;
    line-height: 22px;
    padding: 10px 10px 15px;
}

#confirm_inside h1{
    border-bottom: 1px solid #CCCCCC;
    clear: both;
    color: #C90809;
    font: bold 30px/32px Microsoft YaHei,arial;
    margin: 0 0 10px;
    padding: 10px;
}


#productInfo{
    float: left;
	padding-top: 0px;
	width: 100%;
}


.field_list{
	width:455px;
	float:left;
	margin-left: 0px;

}

.field_input{
    border-bottom: 1px solid #CCCCCC;
    padding: 10px 0 20px 0;
}
.field_input label{
    color: #333333;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    padding-right: 10px;
    text-align: right;
    width: 92px;
	float:left;
font-weight: bold;
}
.field{
    margin:10px;
}
.field label{
    color: #333333;
    font-size: 14px;
    height: 30px;
    line-height: 30px;
    padding-right: 10px;
    text-align: right;
    width: 80px;
	float:left;
font-weight: bold;
}
.field span{
	color:#E31C1F;
	font-size: 14px;
	height: 30px;
    line-height: 30px;
	text-align: left;
font-weight: bold;
}

#pid{
	border: 1px solid #89B4D6;
    font-size: 14px;
    padding: 4px;
}

.checkBtn{
    background: none repeat scroll 0 0 #E31C1F;
    border-color: #FF9900 #FF3300 #FF6633 #FF9900;
    border-style: solid;
    border-width: 2px;
    color: #FFFFFF;
    cursor: pointer;
    height: 25px;
    line-height: 25px;
    padding: 0 3px;
    text-align: center;
}

.clear{
	clear:both;
}

.product_image{
	float:left;
	margin: 15px 10px 15px 30px;
	border: 1px solid #E2E2E2;
    display: block;
    line-height: 0;
    overflow: hidden;
    position: relative;
}
.product_image img {
    height: 210px;
    padding: 1px;
    width: 210px;
}
.product_image span {
    background: none repeat scroll 0 0 #000000;
    bottom: 1px;
    height: 40px;
    left: 1px;
    opacity: 0.5;
	filter:alpha(opacity=50); 
    position: absolute;
    width: 210px;
    z-index: 1;
}
.product_image font {
    font-size:16px;
	font-weight:bold;
	line-height: 30px;
}
.product_image em {
    bottom: 3px;
    color: #FFFFFF;
    height: 30px;
    left: 5px;
    line-height: 22px;
    position: absolute;
    text-align: right;
    width: 195px;
    z-index: 2;
}
.alert{
	font-size:18px;
	color:#E31C1F;
	font-weight:bold;
	padding: 60px 40px;
    text-align: center;
}

.notice {
}
.notice h2 {
    color: #C90809;
    font-size: 14px;
    padding: 10px 0;
}
.notice li {
    background: url("/Public/Images/product/order_bg.png") no-repeat scroll 0 -162px transparent;
    font-size: 12px;
    height: auto;
    line-height: 18px;
    margin: 0 0 10px;
    padding-left: 15px;
}
-->
</style>
<div class="so_main">
  	<div class="page_tit" style="border-bottom: 2px solid #9CB8CC;">礼券详情</div>
  	<div style="margin: 0px auto; width: 960px;">
		<div style="float:right;width:200px;margin-top:15px;">
			<div class="list_info" >
				<h2>详细说明:</h2>
				<div>
					<ul>
				    	<li>礼券不存在，原因：礼券未发放，礼券不存在。</li>
				    	<li>以后后台检查礼券，可能出现的原因写在此。</li>
					</ul>
			    </div>
			</div>
			<div class="list_info" >
				<h2>使用步骤:</h2>
				<div>
					<ul>
				    	<li>录入商品券码，进行验证。</li>
						<li>核实商品券对应的商品。浏览商品信息及<font style="color:red">其他事项</font>，仔细核对。</li>
						<li>确认无误，点击“点击确认兑换”按钮来确定该券已兑换。</li>
						<li>商品券兑换完成。</li>
						<li>提供商品给顾客。</li>
						
					</ul>
			    </div>
			</div>
			<div class="list_info" >
				<h2>注意事项:</h2>
				<div>
					<ul>
				    	<li>请认真核实商品券上商品。</li>
				    	<li>特别注意商品详情中的<font style="color:red">其他事项</font>。例如：可能为非本店可兑换的商品券。</li>
						<li>请在于客户确认后点击“点击确认兑换”按钮。</li>
						<li>如有疑问请联系小心意客服。</li>
					</ul>
			    </div>
			</div>
		</div>
  		<div id="confirm">
			<div id="confirm_inside">
		    	<div class="field_input" style="">
		            <label class="b_input_title">礼券券码:</label>
		            <input id="codevalue" type="text" class="b_input do_input" size="20" value="{$_REQUEST['passcode']}" style="width:150px"/> 
		            <input id="search" class="btn_b" type="button" onclick="dosearch()" value="查&nbsp;询" />
		            <!-- 
		            <input id="douse" class="btn_b" type="button" onclick="docancel()" style="display:none;margin-left: 100px;" 
		            		value="取&nbsp;消" />
		            -->
		        </div>
		
		        <div class="clear"></div>
		        <div id="productInfo" style="display:none">
		        	<div class="product_image" >
		        		<em><font id="coupon_state1"></font></em>
		        		<span></span>
		        		<img id="goods_icon"  src="">
		            </div>
		            <div class="field_list">
		            	<div class="field">
		                <label>订单编号:</label>
		                <span id="order_id"></span>
		                </div>
		            	<div class="field">
		                <label>商品券码:</label><span id="passcode"></span>
		                </div>
		                <div class="field">
		                <label>商品状态:</label><span id="coupon_state"></span>
		                </div>
		                <div class="field">
		                <label>商品品牌:</label><span id="brand_title"></span>
		                </div>
		                <div class="field">
		                <label>商品名称:</label><span id="goods_title"></span>
		                </div>
		                <div class="field">
		                <label>有效期间:</label><span id="validity_period"></span>
		                </div>
		                <div class="field">
		                <label>商品数量:</label><span id="quantity"></span>
		                </div>  
		                <div class="field">
		                <label>其他事项:</label>
		                </div> 
		                <div class="clear"></div> 
		                <div class="field" id="other_info" style="margin: 0px;padding-left:30px;color: #E31C1F;
	    															font-size: 14px; font-weight: bold;">
		                </div>                       
		            </div>
		            <div class="clear"></div>
		      		
			    </div>
		        <div class="clear"></div>
		        <div id="alertinfo" class="alert" style="display:block"><p id='msg' style="text-align:center;line-height: 30px;">录入礼券号码，进行查看！<p></div>
				<div class="clear"></div>
		    </div>
		</div>
		<div class="clear"></div>
	</div>
</div>


<script type="text/javascript">
<php>
if(!empty($_REQUEST['passcode'])){
	</php>
	$(document).ready(function(){
		dosearch();
	});
	<php>
}
</php>
var ifcansearch = true;
function dosearch(){
	if(!ifcansearch){
		ifcansearch = false;
		return;
	}
	showAlert('数据处理中...');
	$.kajax({      
		ajx_rtn_type:'JSON',
		url:"{:U('Admin://Order/ajxCouponDetail')}",      
		type:'post', //数据发送方式  
		data:{codevalue:$('#codevalue').val()} ,    
		async: false ,//同步方式     
		success: function(jsonobj){ 
			//alert(jsonobj.status+jsonobj.msg);
			if(jsonobj.status==1){
				showPinfo(jsonobj.data);
				$('#productInfo').show();
				$('#douse').show();
				$('#alertinfo').hide();
			}else{
				showAlert(jsonobj.msg);
			}
			ifcansearch = true;
		}
	});
}
/**
function docancel(){
	if(!ifcansearch){
		ifcansearch = false;
		return;
	}
	showAlert('数据处理中...');
	$.kajax({      
		ajx_rtn_type:'JSON',
		url:"{:U('Admin://Order/ajxCouponCancel')}",      
		type:'post', //数据发送方式  
		data:{codevalue:$('#codevalue').val()} ,    
		async: false ,//同步方式     
		success: function(jsonobj){ 
			//alert(jsonobj.status+jsonobj.msg);
			if(jsonobj.status==1){
				k_success('商品券兑换成功！');
				showPinfo(jsonobj.data);
				$('#productInfo').show();
				$('#douse').show();
				$('#alertinfo').hide();
			}else{
				showAlert(jsonobj.msg);
				k_error('商品券兑换失败！');
			}
			ifcansearch = true;
		}
	});
}
**/
function showPinfo(data){
	var pjobj = $('#productInfo');
	pjobj.find('#order_id').html("<a href='{:U('Admin://Order/index',array('search_orderId'=>''))}/"+data.order_id+"'>"+data.order_id+"<a>");
	pjobj.find('#goods_icon').attr('src',data.goods_icon);
	pjobj.find('#passcode').html(data.passcode);
	pjobj.find('#goods_title').html(data.goods_title);
	pjobj.find('#validity_period').html(data.validity_period);
	pjobj.find('#coupon_state').html(data.coupon_state);
	pjobj.find('#coupon_state1').html(data.coupon_state);
	pjobj.find('#brand_title').html(data.brand_title);
	pjobj.find('#other_info').html(data.other_info);
	pjobj.find('#quantity').html(data.quantity);
}
function showAlert(msg){
	$('#douse').hide();
	$('#productInfo').hide();
	$('#alertinfo').find('#msg').html(msg);
	$('#alertinfo').show();
}
</script>

<include file="../Public/_footer.html" />